package demoMod.stsconsole.monsters.exordium;

import demoMod.stsconsole.cards.status.Slime;
import demoMod.stsconsole.characters.AbstractPlayer;
import demoMod.stsconsole.helpers.DamageInfo;
import demoMod.stsconsole.monsters.AbstractMonster;
import demoMod.stsconsole.powers.FrailPower;

public class SpikeSlime_M extends AbstractMonster {
    public static final String ID = "SpikeSlime_M";

    public SpikeSlime_M() {
        super(ID);
        setHp(28, 32);
        this.damage.add(new DamageInfo(8, this));
    }

    @Override
    protected void getMove(int aiRng) {
        if (aiRng < 30) {
            if (this.lastTwoMoves((byte)1)) {
                this.setMove(4, Intent.DEBUFF, monsterStrings.get(1));
            } else {
                this.setMove(1, Intent.ATTACK_DEBUFF, this.damage.get(0));
            }
        } else if (this.lastTwoMoves(4)) {
            this.setMove(1, Intent.ATTACK_DEBUFF, this.damage.get(0));
        } else {
            this.setMove(4, Intent.DEBUFF, monsterStrings.get(1));
        }
    }

    @Override
    public void takeTurn() {
        switch (this.nextMove) {
            case 1:
                this.defaultTarget.damage(this.damage.get(0));
                if (this.defaultTarget instanceof AbstractPlayer) {
                    ((AbstractPlayer) this.defaultTarget).makeTempCardsInDiscardPile(new Slime(), 1);
                }
                break;
            case 4:
                this.defaultTarget.applyPower(this, new FrailPower(this.defaultTarget, 2));
                break;
        }
        rollMove();
    }
}
